//1.引入 vue
import Vue from 'vue'

//2.引入vue-touter
import VueRouter from 'vue-router'

import Login from '../view/login'
import  Art from '../view/art'
import List from '../view/list'
import Register from '../view/register'
import NotFound from '../view/NotFound'

//3.使用vie-router
Vue.use(VueRouter)

//4/创建vue-router实例
const router = new VueRouter({
mode:'history',


  routes: [
    {
      path: '/',
      redirect: '/login',
    },
    {
      path: '/login',
      component: Login,
    },
    {
      path: '/art',
      component: Art,
    },
    {
      path: '/list',
      component:List,
    },
    {
      path: '/list/:color',
      component:List,
    },
    {
      path: '/register',
      component:Register,
    },
    {
       path:"/register/:uname/",
       component:Register
    },
    {
      path:"*",
      component:NotFound
   }
  ],
})

//5.导出router
export default router
